home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / ColorSync 2.6 Mac SDK / Interfaces / CMMComponent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-07  |  12.4 KB  |  414 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMMComponent.h
  3.  
  4.      Contains:    ColorSync CMM Component API
  5.  
  6.      Version:    Technology:    ColorSync 2.6
  7.                  Release:    ColorSync 2.6 SDK for use with Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMMCOMPONENT__
  18. #define __CMMCOMPONENT__
  19.  
  20. #ifndef __QUICKDRAW__
  21. #include <Quickdraw.h>
  22. #endif
  23. #ifndef __COMPONENTS__
  24. #include <Components.h>
  25. #endif
  26. #ifndef __CMAPPLICATION__
  27. #include <CMApplication.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52.  
  53. enum {
  54.     CMMInterfaceVersion            = 1
  55. };
  56.  
  57.  
  58. /* Component function selectors */
  59.  
  60. enum {
  61.                                                                 /* Required */
  62.     kNCMMInit                    = 6,
  63.     kCMMMatchColors                = 1,
  64.     kCMMCheckColors                = 2,
  65.  
  66.                                                                 /* Optional */
  67.     kCMMValidateProfile            = 8,
  68.     kCMMMatchBitmap                = 9,
  69.     kCMMCheckBitmap                = 10,
  70.     kCMMMatchPixMap                = 3,
  71.     kCMMCheckPixMap                = 4,
  72.     kCMMConcatenateProfiles        = 5,
  73.     kCMMConcatInit                = 7,
  74.     kCMMNewLinkProfile            = 16,
  75.     kNCMMConcatInit                = 18,
  76.     kNCMMNewLinkProfile            = 19,
  77.     kCMMGetPS2ColorSpace        = 11,
  78.     kCMMGetPS2ColorRenderingIntent = 12,
  79.     kCMMGetPS2ColorRendering    = 13,
  80.     kCMMGetPS2ColorRenderingVMSize = 17,
  81.  
  82.                                                                 /* obsolete with ColorSync 2.5 */
  83.     kCMMFlattenProfile            = 14,
  84.     kCMMUnflattenProfile        = 15,
  85.  
  86.                                                                 /* obsolete with ColorSync 2.6 */
  87.     kCMMInit                    = 0,
  88.     kCMMGetNamedColorInfo        = 70,
  89.     kCMMGetNamedColorValue        = 71,
  90.     kCMMGetIndNamedColorValue    = 72,
  91.     kCMMGetNamedColorIndex        = 73,
  92.     kCMMGetNamedColorName        = 74
  93. };
  94.  
  95.  
  96. enum {
  97.     kCMMOpen                    = kComponentOpenSelect,
  98.     kCMMClose                    = kComponentCloseSelect,
  99.     kCMMGetInfo                    = kComponentVersionSelect
  100. };
  101.  
  102. #if TARGET_OS_MAC
  103. typedef ComponentInstance                 CMMComponentInst;
  104. EXTERN_API( CMError )
  105. NCMMInit                        (CMMComponentInst         cmm,
  106.                                  CMProfileRef             srcProfile,
  107.                                  CMProfileRef             dstProfile)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  108.  
  109. EXTERN_API( CMError )
  110. CMMInit                            (CMMComponentInst         cmm,
  111.                                  CMProfileHandle         srcProfile,
  112.                                  CMProfileHandle         dstProfile)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0000, 0x7000, 0xA82A);
  113.  
  114. EXTERN_API( CMError )
  115. CMMMatchColors                    (CMMComponentInst         cmm,
  116.                                  CMColor *                colors,
  117.                                  UInt32                 count)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  118.  
  119. EXTERN_API( CMError )
  120. CMMCheckColors                    (CMMComponentInst         cmm,
  121.                                  CMColor *                colors,
  122.                                  UInt32                 count,
  123.                                  UInt32 *                result)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  124.  
  125. EXTERN_API( CMError )
  126. CMMValidateProfile                (CMMComponentInst         cmm,
  127.                                  CMProfileRef             prof,
  128.                                  Boolean *                valid)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  129.  
  130. EXTERN_API( CMError )
  131. CMMFlattenProfile                (CMMComponentInst         cmm,
  132.                                  CMProfileRef             prof,
  133.                                  UInt32                 flags,
  134.                                  CMFlattenUPP             proc,
  135.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000E, 0x7000, 0xA82A);
  136.  
  137. EXTERN_API( CMError )
  138. CMMUnflattenProfile                (CMMComponentInst         cmm,
  139.                                  FSSpec *                resultFileSpec,
  140.                                  CMFlattenUPP             proc,
  141.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  142.  
  143. EXTERN_API( CMError )
  144. CMMMatchBitmap                    (CMMComponentInst         cmm,
  145.                                  CMBitmap *                bitmap,
  146.                                  CMBitmapCallBackUPP     progressProc,
  147.                                  void *                    refCon,
  148.                                  CMBitmap *                matchedBitmap)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x0009, 0x7000, 0xA82A);
  149.  
  150. EXTERN_API( CMError )
  151. CMMCheckBitmap                    (CMMComponentInst         cmm,
  152.                                  const CMBitmap *        bitmap,
  153.                                  CMBitmapCallBackUPP     progressProc,
  154.                                  void *                    refCon,
  155.                                  CMBitmap *                resultBitmap)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x000A, 0x7000, 0xA82A);
  156.  
  157. EXTERN_API( CMError )
  158. CMMMatchPixMap                    (CMMComponentInst         cmm,
  159.                                  PixMap *                pixMap,
  160.                                  CMBitmapCallBackUPP     progressProc,
  161.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  162.  
  163. EXTERN_API( CMError )
  164. CMMCheckPixMap                    (CMMComponentInst         cmm,
  165.                                  const PixMap *            pixMap,
  166.                                  CMBitmapCallBackUPP     progressProc,
  167.                                  BitMap *                bitMap,
  168.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0004, 0x7000, 0xA82A);
  169.  
  170. EXTERN_API( CMError )
  171. CMMConcatInit                    (CMMComponentInst         cmm,
  172.                                  CMConcatProfileSet *    profileSet)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  173.  
  174. EXTERN_API( CMError )
  175. NCMMConcatInit                    (CMMComponentInst         cmm,
  176.                                  NCMConcatProfileSet *    profileSet,
  177.                                  CMConcatCallBackUPP     proc,
  178.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0012, 0x7000, 0xA82A);
  179.  
  180. EXTERN_API( CMError )
  181. CMMNewLinkProfile                (CMMComponentInst         cmm,
  182.                                  CMProfileRef *            prof,
  183.                                  const CMProfileLocation * targetLocation,
  184.                                  CMConcatProfileSet *    profileSet)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  185.  
  186. EXTERN_API( CMError )
  187. NCMMNewLinkProfile                (CMMComponentInst         cmm,
  188.                                  CMProfileRef             prof,
  189.                                  NCMConcatProfileSet *    profileSet,
  190.                                  CMConcatCallBackUPP     proc,
  191.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0013, 0x7000, 0xA82A);
  192.  
  193. EXTERN_API( CMError )
  194. CMMGetPS2ColorSpace                (CMMComponentInst         cmm,
  195.                                  CMProfileRef             srcProf,
  196.                                  UInt32                 flags,
  197.                                  CMFlattenUPP             proc,
  198.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000B, 0x7000, 0xA82A);
  199.  
  200. EXTERN_API( CMError )
  201. CMMGetPS2ColorRenderingIntent    (CMMComponentInst         cmm,
  202.                                  CMProfileRef             srcProf,
  203.                                  UInt32                 flags,
  204.                                  CMFlattenUPP             proc,
  205.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x000C, 0x7000, 0xA82A);
  206.  
  207. EXTERN_API( CMError )
  208. CMMGetPS2ColorRendering            (CMMComponentInst         cmm,
  209.                                  CMProfileRef             srcProf,
  210.                                  CMProfileRef             dstProf,
  211.                                  UInt32                 flags,
  212.                                  CMFlattenUPP             proc,
  213.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x000D, 0x7000, 0xA82A);
  214.  
  215. EXTERN_API( CMError )
  216. CMMGetPS2ColorRenderingVMSize    (CMMComponentInst         cmm,
  217.                                  CMProfileRef             srcProf,
  218.                                  CMProfileRef             dstProf,
  219.                                  UInt32 *                vmSize)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  220.  
  221. EXTERN_API( CMError )
  222. CMMConcatenateProfiles            (CMMComponentInst         cmm,
  223.                                  CMProfileHandle         thru,
  224.                                  CMProfileHandle         dst,
  225.                                  CMProfileHandle *        newDst)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0005, 0x7000, 0xA82A);
  226.  
  227. EXTERN_API( CMError )
  228. CMMGetNamedColorInfo            (CMMComponentInst         cmm,
  229.                                  CMProfileRef             srcProf,
  230.                                  UInt32 *                deviceChannels,
  231.                                  OSType *                deviceColorSpace,
  232.                                  OSType *                PCSColorSpace,
  233.                                  UInt32 *                count,
  234.                                  StringPtr                 prefix,
  235.                                  StringPtr                 suffix)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x0046, 0x7000, 0xA82A);
  236.  
  237. EXTERN_API( CMError )
  238. CMMGetNamedColorValue            (CMMComponentInst         cmm,
  239.                                  CMProfileRef             prof,
  240.                                  StringPtr                 name,
  241.                                  CMColor *                deviceColor,
  242.                                  CMColor *                PCSColor)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0047, 0x7000, 0xA82A);
  243.  
  244. EXTERN_API( CMError )
  245. CMMGetIndNamedColorValue        (CMMComponentInst         cmm,
  246.                                  CMProfileRef             prof,
  247.                                  UInt32                 index,
  248.                                  CMColor *                deviceColor,
  249.                                  CMColor *                PCSColor)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0048, 0x7000, 0xA82A);
  250.  
  251. EXTERN_API( CMError )
  252. CMMGetNamedColorIndex            (CMMComponentInst         cmm,
  253.                                  CMProfileRef             prof,
  254.                                  StringPtr                 name,
  255.                                  UInt32 *                index)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0049, 0x7000, 0xA82A);
  256.  
  257. EXTERN_API( CMError )
  258. CMMGetNamedColorName            (CMMComponentInst         cmm,
  259.                                  CMProfileRef             prof,
  260.                                  UInt32                 index,
  261.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x004A, 0x7000, 0xA82A);
  262.  
  263. #if OLDROUTINENAMES
  264. #define NCMInit(cmm, srcProfile, dstProfile)    NCMMInit(cmm, srcProfile, dstProfile)
  265. #define CMInit(cmm, srcProfile, dstProfile)    CMMInit(cmm, srcProfile, dstProfile)
  266. #define CMMatchColors(cmm, colors, count)        CMMMatchColors(cmm, colors, count)
  267. #define CMCheckColors(cmm, colors, count, result)    CMMCheckColors(cmm, colors, count, result)
  268. #define CMMatchBitmap(cmm, bitmap, progressProc, refCon, matchedBitmap)    CMMMatchBitmap(cmm, bitmap, progressProc, refCon, matchedBitmap)
  269. #define CMCheckBitmap(cmm, bitmap, progressProc, refCon, resultBitmap)    CMMCheckBitmap(cmm, bitmap, progressProc, refCon, resultBitmap)
  270. #define CMMatchPixMap(cmm, pixMap, progressProc, refCon)    CMMMatchPixMap(cmm, pixMap, progressProc, refCon)
  271. #define CMCheckPixMap(cmm, pixMap, progressProc, bitMap, refCon)    CMMCheckPixMap(cmm, pixMap, progressProc, bitMap, refCon)
  272. #define CMConcatInit(cmm, profileSet)    CMMConcatInit(cmm, profileSet)
  273. #define CMConcatenateProfiles(cmm, thru, dst, newDst) CMMConcatenateProfiles(cmm, thru, dst, newDst)
  274. #define CMNewLinkProfile(cmm, prof, targetLocation, profileSet)    CMMNewLinkProfile(cmm, prof, targetLocation, profileSet)
  275. #endif  /* OLDROUTINENAMES */
  276.  
  277. #endif  /* TARGET_OS_MAC */
  278.  
  279. #if TARGET_OS_WIN32
  280. EXTERN_API( CMError )
  281. CMMOpen                            (UInt32 *                cmmStorage,
  282.                                  void *                    hInstance);
  283.  
  284. EXTERN_API( CMError )
  285. CMMClose                        (UInt32 *                cmmStorage);
  286.  
  287. EXTERN_API( CMError )
  288. CMMGetCMMInfo                    (UInt32 *                cmmStorage,
  289.                                  CMMInfo *                info);
  290.  
  291. EXTERN_API( CMError )
  292. NCMMInit                        (UInt32 *                cmmStorage,
  293.                                  CMProfileRef             srcProfile,
  294.                                  CMProfileRef             dstProfile);
  295.  
  296. EXTERN_API( CMError )
  297. CMMMatchColors                    (UInt32 *                cmmStorage,
  298.                                  CMColor *                colors,
  299.                                  UInt32                 count);
  300.  
  301. EXTERN_API( CMError )
  302. CMMCheckColors                    (UInt32 *                cmmStorage,
  303.                                  CMColor *                colors,
  304.                                  UInt32                 count,
  305.                                  UInt32 *                result);
  306.  
  307. EXTERN_API( CMError )
  308. CMMValidateProfile                (UInt32 *                cmmStorage,
  309.                                  CMProfileRef             prof,
  310.                                  Boolean *                valid);
  311.  
  312. EXTERN_API( CMError )
  313. CMMMatchBitmap                    (UInt32 *                cmmStorage,
  314.                                  CMBitmap *                bitmap,
  315.                                  CMBitmapCallBackUPP     progressProc,
  316.                                  void *                    refCon,
  317.                                  CMBitmap *                matchedBitmap);
  318.  
  319. EXTERN_API( CMError )
  320. CMMCheckBitmap                    (UInt32 *                cmmStorage,
  321.                                  const CMBitmap *        bitmap,
  322.                                  CMBitmapCallBackUPP     progressProc,
  323.                                  void *                    refCon,
  324.                                  CMBitmap *                resultBitmap);
  325.  
  326. EXTERN_API( CMError )
  327. CMMMatchPixMap                    (UInt32 *                cmmStorage,
  328.                                  PixMap *                pixMap,
  329.                                  CMBitmapCallBackUPP     progressProc,
  330.                                  void *                    refCon);
  331.  
  332. EXTERN_API( CMError )
  333. CMMCheckPixMap                    (UInt32 *                cmmStorage,
  334.                                  const PixMap *            pixMap,
  335.                                  CMBitmapCallBackUPP     progressProc,
  336.                                  BitMap *                bitMap,
  337.                                  void *                    refCon);
  338.  
  339. EXTERN_API( CMError )
  340. CMMConcatInit                    (UInt32 *                cmmStorage,
  341.                                  CMConcatProfileSet *    profileSet);
  342.  
  343. EXTERN_API( CMError )
  344. NCMMConcatInit                    (UInt32 *                cmmStorage,
  345.                                  NCMConcatProfileSet *    profileSet,
  346.                                  CMConcatCallBackUPP     proc,
  347.                                  void *                    refCon);
  348.  
  349. EXTERN_API( CMError )
  350. CMMNewLinkProfile                (UInt32 *                cmmStorage,
  351.                                  CMProfileRef *            prof,
  352.                                  const CMProfileLocation * targetLocation,
  353.                                  CMConcatProfileSet *    profileSet);
  354.  
  355. EXTERN_API( CMError )
  356. NCMMNewLinkProfile                (UInt32 *                cmmStorage,
  357.                                  CMProfileRef             prof,
  358.                                  NCMConcatProfileSet *    profileSet,
  359.                                  CMConcatCallBackUPP     proc,
  360.                                  void *                    refCon);
  361.  
  362. EXTERN_API( CMError )
  363. CMMGetPS2ColorSpace                (UInt32 *                cmmStorage,
  364.                                  CMProfileRef             srcProf,
  365.                                  UInt32                 flags,
  366.                                  CMFlattenUPP             proc,
  367.                                  void *                    refCon);
  368.  
  369. EXTERN_API( CMError )
  370. CMMGetPS2ColorRenderingIntent    (UInt32 *                cmmStorage,
  371.                                  CMProfileRef             srcProf,
  372.                                  UInt32                 flags,
  373.                                  CMFlattenUPP             proc,
  374.                                  void *                    refCon);
  375.  
  376. EXTERN_API( CMError )
  377. CMMGetPS2ColorRendering            (UInt32 *                cmmStorage,
  378.                                  CMProfileRef             srcProf,
  379.                                  CMProfileRef             dstProf,
  380.                                  UInt32                 flags,
  381.                                  CMFlattenUPP             proc,
  382.                                  void *                    refCon);
  383.  
  384. EXTERN_API( CMError )
  385. CMMGetPS2ColorRenderingVMSize    (UInt32 *                cmmStorage,
  386.                                  CMProfileRef             srcProf,
  387.                                  CMProfileRef             dstProf,
  388.                                  UInt32 *                vmSize);
  389.  
  390.  
  391. #endif  /* TARGET_OS_WIN32 */
  392.  
  393.  
  394. #if PRAGMA_STRUCT_ALIGN
  395.     #pragma options align=reset
  396. #elif PRAGMA_STRUCT_PACKPUSH
  397.     #pragma pack(pop)
  398. #elif PRAGMA_STRUCT_PACK
  399.     #pragma pack()
  400. #endif
  401.  
  402. #ifdef PRAGMA_IMPORT_OFF
  403. #pragma import off
  404. #elif PRAGMA_IMPORT
  405. #pragma import reset
  406. #endif
  407.  
  408. #ifdef __cplusplus
  409. }
  410. #endif
  411.  
  412. #endif /* __CMMCOMPONENT__ */
  413.  
  414.